import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBEngineer/YBBaseRouter/YBNavigator.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBImageStyle/YBImageStyle.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBTextStyle/YBTextStyle.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/yb_chinese_text/yb_chinese_text.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBModule/yb_wenshu_main/yb_wenshu_subpage/yb_wenshu_mainlist_subpage.dart';


class YBWenShuMainPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {

    List<String> imageStrList = ["mingshang_caijue","xingzheng_caijue","xingshi_caijue","zhongcai_falv","gongzheng_falv","susong_falv","feisu_falv","gongsi_guanli","gongsi_qingsuan","changyong"];

    List<String> titleStrList = ["民商裁决文书","行政裁决文书","刑事裁决文书","仲裁法律文书","公证法律文书","诉讼法律文书","非诉法律文书","公司管理文书","公司清算文书","常用法律文书"];





    return Container(
      child: Scaffold(
        appBar: AppBar(
          elevation: 0,
          title: Expanded(
            child: Container(
              child: Text(
                YBChineseText.wenShuTitle,
                style: YBTextStyle.TextStyle30313320Medium,
              ),
            ),
          ),
          actions: [
            Container(
              child: InkWell(
                child: Padding(
                  padding: EdgeInsets.only(right: YBTextStyle.adapterSize20),
                  child: SvgPicture.asset(YBImageStyle.getSVGPath("search")),
                ),
                onTap: () async{

                },
              ),
            ),
          ],
        ),
        //
        body:GridView.builder(
            gridDelegate:SliverGridDelegateWithFixedCrossAxisCount(
                crossAxisSpacing: YBTextStyle.adapterSize20,
                crossAxisCount: 2,
                mainAxisSpacing: YBTextStyle.adapterSize20,
                childAspectRatio: 1.5,
            ),
            itemCount: imageStrList.length,
            itemBuilder:(BuildContext context, int index){
              return InkWell(
                child: YBWenShuMainListSubPage(imageStr:imageStrList[index],titleStr:titleStrList[index],),
                onTap: () async {
                  YBNavigatorUtil.jump(context, "/wenshuPage/wenshuTypeListDetailPage");
                },
              );
            }
        ),
      ),
    );
  }
}
